<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="button" v-on:click="doit" value="v-on:click">
        <input type="button" @click="doit" value="@click">
        <input type="button" @dblclick="doit" value="dblclick">
        <h2 @click="changefood">{{food}}</h2>
    </div>
    <script>
        var app=new Vue({
            el:"#app",
            data:{
                food:"西兰花炒蛋"
            },
            methods:{
                doit:function(){
                    alert("doit")
                },
                changefood:function(){
                    console.log(this.food)
                }
            }
        })
    </script>
</body>
</html>
